import java.util.Arrays;//导入Arrays类用于排序
import java.util.Scanner;

public class TianJiSaiMa {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] v = new int[3];
        int[] a = new int[3];

        for (int i = 0; i < 3; i++) {
            v[i] = scanner.nextInt();
        }
        for (int i = 0; i < 3; i++) {
            a[i] = scanner.nextInt();
        }

        Arrays.sort(v);
        Arrays.sort(a);

        int i = 2, j = 2;
        int winCount = 0;

        while (i >= 0 && j >= 0) {
            if (a[i] > v[j]) {
                winCount++;
                i--;
                j--;
            } else {
                j--;
            }
        }

        if (winCount >= 2) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }

        scanner.close();
    }
}